import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { EmgRescueVO, EmgRescueForm, EmgRescueQuery } from '@/api/biz/emgRescue/types';

/**
 * 查询社会救援中心列表
 * @param query
 * @returns {*}
 */

export const listEmgRescue = (query?: EmgRescueQuery): AxiosPromise<EmgRescueVO[]> => {
  return request({
    url: '/biz/emgRescue/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询社会救援中心详细
 * @param id
 */
export const getEmgRescue = (id: string | number): AxiosPromise<EmgRescueVO> => {
  return request({
    url: '/biz/emgRescue/' + id,
    method: 'get'
  });
};

/**
 * 新增社会救援中心
 * @param data
 */
export const addEmgRescue = (data: EmgRescueForm) => {
  return request({
    url: '/biz/emgRescue',
    method: 'post',
    data: data
  });
};

/**
 * 修改社会救援中心
 * @param data
 */
export const updateEmgRescue = (data: EmgRescueForm) => {
  return request({
    url: '/biz/emgRescue',
    method: 'put',
    data: data
  });
};

/**
 * 删除社会救援中心
 * @param id
 */
export const delEmgRescue = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/emgRescue/' + id,
    method: 'delete'
  });
};
